﻿<Window x:Class="CannedBytes.Midi.SysExUtil.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:appui="clr-namespace:CannedBytes.Midi.SysExUtil.UI"
        Title="MIDI System Exclusive Utility" Height="350" Width="525">

    <Grid>
        <DockPanel LastChildFill="true">
            <ToolBar Name ="MidiToolbar" DockPanel.Dock="Top">
                <Button Name="FileNew" Content="{Binding Mode=OneWay, Path=Command.Text, RelativeSource={RelativeSource self} }" Command="appui:AppCommands.FileNew" />
                <Button Name="FileOpen" Content="{Binding Mode=OneWay, Path=Command.Text, RelativeSource={RelativeSource self} }" Command="appui:AppCommands.FileOpen" />
                <Button Name="FileSave" Content="{Binding Mode=OneWay, Path=Command.Text, RelativeSource={RelativeSource self} }" Command="appui:AppCommands.FileSave" />
                <Separator />
                <Label>In:</Label>
                <ComboBox Name="MidiInPorts" ItemsSource="{Binding MidiInPorts}" Width="100" SelectedItem="{Binding SelectedMidiInPort, Mode=TwoWay}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <Button Name="StartStop" Content="{Binding Mode=OneWay, Path=Command.Text, RelativeSource={RelativeSource self} }" Command="appui:AppCommands.StartStop" />
                <Separator />
                <Label>Out:</Label>
                <ComboBox Name="MidiOutPorts" ItemsSource="{Binding MidiOutPorts}" Width="100" SelectedItem="{Binding SelectedMidiOutPort, Mode=TwoWay}">
                    <ComboBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                </ComboBox>
                <Button Name="Play" Content="{Binding Mode=OneWay, Path=Command.Text, RelativeSource={RelativeSource self} }" Command="appui:AppCommands.Play" />
                <TextBlock Text="RecvErr:" />
                <TextBlock Text="{Binding ReceiveErrorCount}" />
            </ToolBar>
            <ListBox Name="ContentList" ItemsSource="{Binding SysExBuffers}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged"
                     HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" HorizontalAlignment="Stretch" TextWrapping="Wrap" Margin="2,4,2,2" />
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </DockPanel>
    </Grid>
</Window>